package com.eclipse.e0112_io.考试;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

public class 加载属性文件 {
	public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
		
		Student stu = new Student();
		stu.name="gin";
		ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("/Users/liuzhuangzhuang/Desktop/io/xuliehua1.data"));
		oos.writeObject(stu);
		oos.close();
		
		
		ObjectInputStream ois = new ObjectInputStream(new FileInputStream("/Users/liuzhuangzhuang/Desktop/io/xuliehua1.data"));
		Student stu2 = (Student)ois.readObject();
		System.out.println(stu2.name);
	}
}

class Student implements Serializable{
	private static final long serialVersionUID = 2L;
	String name;
	
}